package com.tj.jinzao.adapter;

import android.content.Context;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.tj.jinzao.R;
import com.tj.jinzao.common.Constant;
import com.tj.jinzao.widgets.RoundedImageView;

import java.util.List;

public class GroupAdapter extends Base_Adapter {


    public GroupAdapter(Context context, List list, boolean isFirst) {
        super(context, list, isFirst);
    }

    @Override
    public View getView(int i, View view, ViewGroup viewGroup) {
        ViewHolder viewHolder;
        if(view==null){
            viewHolder=new ViewHolder();
            view= LayoutInflater.from(context).inflate(R.layout.item_group,null);
            viewHolder.avatar=findView(view,R.id.avatar);
            view.setTag(viewHolder);
        }else {
            viewHolder= (ViewHolder) view.getTag();
        }

        if(i==list.size()-1){
            Log.w("数据华东","666");
            viewHolder.avatar.setImageResource(R.drawable.add_friend);
        }else {
            Log.w("数据华东","8888");
            displayImage(Constant.IMAGE_PREFIX +list.get(i),viewHolder.avatar);
        }

        return view;
    }
    class ViewHolder{
        RoundedImageView avatar;

    }
}
